*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --fw-light: 300;
  --fw-normal: 400;
  --fw-semi: 500;
  --fw-bold: 700;
  --fs-h1: 1.5rem;
  --fs-h2: 2.25rem;
  --fs-body: 1rem;
  --fs-xl: 4.5rem;
  --clr-light: #fff;
  --clr-gray: #989898;
  --clr-dark: #444;
  --clr-accent: #D06D6D;
  --clr-accent-dark: #613131;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/308367/mars.jpg);
  background-size: cover;
  height: 100vh;
  overflow: hidden;
  color: var(--clr-gray);
}

.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

h1, h2 {
  line-height: 1;
}

.main-title {
  font-size: var(--fs-h1);
  font-weight: var(--fw-light);
  color: var(--clr-accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 .5em 0;
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: var(--clr-light);
  margin: 0;
}

.section-title--date {
  font-size: var(--fs-xl);
}

a {
  color: var(--clr-accent);
}

a:hover {
  color: var(--clr-light);
}

.mars-current-weather {
  background: rgba(0, 0, 0, 0.75);
  padding: 2em;
  margin: 4em 0 0 4em;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 2em;
  max-width: 1000px;
}

.main-title {
  grid-column: 1 / -1;
}

.reading {
  font-size: var(--fs-h1);
  line-height: 1.4;
  margin: 0;
  color: var(--clr-gray);
}

.date__day {
  font-size: var(--fs-h2);
  color: var(--clr-gray);
  line-height: 1;
  margin: 0;
  font-weight: var(--fw-light);
}

.temp {
  border-left: solid 0.25em var(--clr-accent-dark);
  border-right: solid 0.25em var(--clr-accent-dark);
  padding: 0 2em;
}

.wind {
  display: grid;
  grid-column: repeat(2, 1fr);
  grid-column-gap: 1rem;
  justify-content: start;
  align-items: start;
}

.wind .section-title, .wind .reading {
  grid-column: 2 / 3;
  margin: 0;
}

.wind__direction {
  --size: 6rem;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  grid-row: 1 / 3;
  grid-column: 1 / 2;
  display: grid;
  place-items: center;
}

.wind__arrow {
  --direction: 0deg;
  --size: 1rem;
  height: calc(var(--size) * 3);
  width: var(--size);
  background: var(--clr-accent-dark);
  clip-path: polygon(50% 0, 0% 100%, 100% 100%);
  transform: translateY(-50%) rotate(var(--direction));
  transform-origin: bottom center;
  transition: transform 500ms cubic-bezier(0, .5, .5, 1);
}

.unit {
  place-self: end;
  display: flex;
}

.unit__toggle {
  cursor: pointer;
  margin: 0 1em;
  width: 4em;
  border: 2px solid var(--clr-gray);
  background: transparent;
  border-radius: 100vw;
  position: relative;
  display: flex;
  padding: 0;
  transition: border-color 250ms;
}

.unit__toggle:hover {
  --clr-gray: #fff;
}

.unit__toggle::after {
  content: '';
  background: var(--clr-gray);
  border-radius: 100vmax;
  margin: 3px;
  height: 15px;
  width: calc(50% - 8px);
  transition: background-color 250ms;
}

.unit__toggle[aria-checked="true"]::after {
  margin-left: auto;
}

.info {
  grid-column: 1 / 3;
  color: var(clr-light);
}

.previous-weather {
  background: white;
  padding: 2rem 4rem;
  color: var(--clr-gray);
  position: absolute;
  bottom: 0;
  transform: translateY(60%);
  width: 100%;
  transition: transform 350ms ease;
}

.show-previous-weather-toggle {
  display: none;
}

.show-previous-weather-label {
  position: absolute;
  background: var(--clr-light);
  top: 0;
  /* 9rem = width */
  transform: translate(calc(50% - 9rem), -100%);
  left: 50%;
  border: 0;
  width: 9rem;
  height: 2rem;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 0% 100%, 100% 100%);
  font-size: 2em;
  line-height: 1;
  font-weight: var(--fw-semi);
  transition: transform 200ms ease;
}

.previous-days {
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(100px);
  transition: opacity 250ms linear 200ms, transform 750ms cubic-bezier(0, 0.5, 0.5, 1);
}

.previous-day > * {
  margin: 0;
}

.previous-day__sol {
  color: var(--clr-dark);
}

.show-weather {
  transform: translateY(0);
}

.show-weather .previous-days {
  opacity: 1;
  transform: translateY(0);
}

.show-weather label * {
  transform: rotate(180deg) translateY(-.15em);
  transform-origin: center;
}


.more-info {
  cursor: pointer;
  margin-top: 1em;
  border: 0;
  border-radius: 100vw;
  background: var(--clr-gray);
  color: var(--clr-light);
  text-transform: uppercase;
  padding: .25em .75em;
}

.more-info:hover {
  background: var(--clr-accent-dark)
}